#!/bin/sh
#set -x
#set -o errexit
c_files=*.c
cpp_files=*.cpp
if [ $# -gt 0 ] ; then
    base=`basename $1 .c`
    echo "==> Removing $base"
    rm -rf $base
else
    if [ -n "$c_files" ] ; then
        for i in *.c; do
            base=`basename $i .c`
            echo "==> Removing  $base"
            rm -rf $base
        done
    elif [ -n "$cpp_files" ] ; then
        for i in *.cpp; do
            base=`basename $i .cpp`
            echo "==> Removing  $base"
            rm -rf $base
        done
    else
        echo "***no .c or .cpp source code file found***"
        exit 1
    fi
fi
